<!--
* description: 文本输入框通用组件
* author: luojx
* createdDate: 2019-07-30
*  2019-08-09 修改文字溢出效果-封装/校验效果 liyanm
*  2019-08-15 增加输入框类型判断，默认text   yinxy
-->
<template>
  <el-col :span="span" style="margin-bottom:0px;text-align:left;">
    <lableName    :validrule="validrule"   
      :curLabelName="curLabelName"
      :isShowLabel="isShowLabel"
      :isRequire="isRequire"
    ></lableName>
    <!-- <el-input
      :style="setInputWidth(span)"
      placeholder="请输入"
      v-model="modelCode"
      :disabled="disabled"
      size="small"
      :suffix-icon="suffixIcon"
      @clear="clearCode"
      clearable
      @blur="sendCode1"
      :type="inputType"
    ></el-input> -->

    <el-rate v-model="modelCode"
     show-text 
     :texts="pfsz" 
     @change="sendCode1"
    ></el-rate>
    <validateFormate
      :curLabelName="curLabelName"
      :validrule="validrule"
    ></validateFormate>
  </el-col>
</template>
<script>
import { inputMixins } from "@/components/mixins/inputMixins";
// import lableName from "@/components/lableName";
// import validateFormate from "@/components/validateFormate";
export default {
  name:'crmRate',
  mixins: [inputMixins],
  components: {
    lableName: () => import("@/components/lableName"), //标题溢出样式组件
    validateFormate: () => import("@/components/validateFormate"), //校验提示样式组件
  },
  data() {
    return {
      pfsz: ['差', '较差', '一般', '好', '很好'],
      modelCode:5
    };
  },
  methods:{
    sendCode1(){
      debugger
      let val=this.modelCode;
      let text=this.codeField
      this.$emit("changeCode", val,text);
      this.sendCode()
    },
    setInputWidth(span){
      switch(span){
        case 6:return '';
        case 12:return 'width:85%';
      }
    }
  }
};
</script>
